Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard: Single file mode #4188

Merged
merged 8 commits into from
Nov 10, 2022
Merged

Dashboard: Single file mode #4188

merged 8 commits into from
Nov 10, 2022

Conversation

arturi
Copy link
Contributor

@arturi arturi commented Nov 4, 2022

With only one file / image selected, display it large and centered, and re-generate image preview so it's 600px large.

Screen Shot 2022-11-04 at 17 02 24

Screen Shot 2022-11-04 at 16 48 43

Screen Shot 2022-11-04 at 16 50 51

Screen Shot 2022-11-04 at 16 49 16

Fixes #3970.

@arturi arturi requested review from nqst and aduh95 November 4, 2022 17:30
@elliotsayes
Copy link
Contributor

Awesome! I would love to have this for my app

Copy link
Contributor

@nqst nqst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! 👍

One nitpick:

Screenshot 07-11-2022 at 10 03 29@2x

Think there's no need to trim the filename the way we do it in the multi-file mode. Do you think we can increase the visible filename length?

Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if @nqst's nitpick is also done

@arturi arturi removed the request for review from aduh95 November 7, 2022 17:33
@@ -138,6 +138,7 @@ export default function Dashboard (props) {
<FileList
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
singleFile={singleFile}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we use itemsPerRow instead of a new prop? If that's 1 it means the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's based on width, so it's 3 for single file on full-width Dashboard for me.

@arturi arturi merged commit a2a265a into main Nov 10, 2022
@arturi arturi deleted the dashboard-single-img branch November 10, 2022 00:05
@oalexdoda
Copy link

Does this also fix that cancel event @arturi ? Thanks!

@github-actions github-actions bot mentioned this pull request Nov 10, 2022
github-actions bot added a commit that referenced this pull request Nov 10, 2022
| Package                | Version | Package                | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/angular          |   0.5.0 | @uppy/image-editor     |   2.1.0 |
| @uppy/aws-s3-multipart |   3.1.0 | @uppy/locales          |   3.0.4 |
| @uppy/companion        |   4.1.0 | @uppy/tus              |   3.0.5 |
| @uppy/companion-client |   3.1.0 | @uppy/utils            |   5.1.0 |
| @uppy/dashboard        |   3.2.0 | uppy                   |   3.3.0 |

- @uppy/companion: change default S3 expiry from 300 to 800 seconds (Merlijn Vos / #4206)
- @uppy/dashboard: Single file mode (Artur Paikin / #4188)
- @uppy/locales: Fix UZ locale (Merlijn Vos / #4178)
- @uppy/utils: update typings for `RateLimitedQueue` (Antoine du Hamel / #4204)
- @uppy/aws-s3-multipart: empty the queue when pausing (Antoine du Hamel / #4203)
- @uppy/image-editor: add checkered background (Livia Medeiros / #4194)
- @uppy/aws-s3-multipart: refactor rate limiting approach (Antoine du Hamel / #4187)
- @uppy/companion: send expiry time along side S3 signed requests (Antoine du Hamel / #4202)
- @uppy/companion-client: add support for `AbortSignal` (Antoine du Hamel / #4201)
- @uppy/companion-client: prevent preflight race condition (Mikael Finstad / #4182)
- @uppy/aws-s3-multipart: change limit to 6 (Antoine du Hamel / #4199)
- @uppy/utils: add `cause` support for `AbortError`s (Antoine du Hamel / #4198)
- meta: Fix bad example for setFileState (Tim Whitney / #4191)
- meta: Update code example for getFiles (Tim Whitney / #4189)
- meta: Fix issue with outdated comment. (Tim Whitney / #4192)
- @uppy/aws-s3-multipart: remove unused `timeout` option (Antoine du Hamel / #4186)
- meta: Remove dollar sign from command for easier copy/pasting (Youssef Victor / #4180)
- @uppy/aws-s3-multipart,@uppy/tus: fix `Timed out waiting for socket` (Antoine du Hamel / #4177)
- meta: Add note about facebook approval (Mikael Finstad / #4172)
- meta: add a manual deploy for website (Antoine du Hamel / #4171)
Murderlon added a commit that referenced this pull request Dec 1, 2022
* main: (110 commits)
  @uppy/aws-s3-multipart: handle slow connections better (#4213)
  @uppy/companion-client: treat `*` the same as missing header (#4221)
  @uppy/utils: fix types (#4212)
  @uppy/companion: send expire info for non-multipart uploads (#4214)
  docs: fix `allowedMetaFields` documentation (#4216)
  meta: add more bundlers for automated testing (#4100)
  @uppy/aws-s3-multipart: Fix typo in url check (#4211)
  meta: use current version of packages when testing bundlers (#4208)
  meta: do not use the set-output command in workflows (#4175)
  Release: uppy@3.3.0 (#4207)
  Companion: change default S3 expiry from 300 to 800 seconds (#4206)
  Dashboard: Single file mode (#4188)
  Fix UZ locale (#4178)
  @uppy/utils: update typings for `RateLimitedQueue` (#4204)
  @uppy/aws-s3-multipart: empty the queue when pausing (#4203)
  image-editor: add checkered background (#4194)
  @uppy/aws-s3-multipart: refactor rate limiting approach (#4187)
  @uppy/companion: send expiry time along side S3 signed requests (#4202)
  @uppy/companion-client: add support for `AbortSignal` (#4201)
  @uppy/companion-client: prevent preflight race condition (#4182)
  ...
@jdcalvin
Copy link

jdcalvin commented Jan 19, 2023

@arturi How do you disable this feature? I need to bump dashboard to latest, but this does not render correctly for my implementation with the only added option disableThumbnailGenerator set to true. It does not render the dimensions properly.

image

@arturi
Copy link
Contributor Author

arturi commented Feb 7, 2023

Hi @jdcalvin, it’s indeed a bug with the layout, I’m working on fixing it. As for the option to disable Single File mode altogether — we’ll consider it.

@jdcalvin
Copy link

@arturi any update on this, or is there a issue tracked somewhere for it?

@Murderlon
Copy link
Member

@arturi is currently working on it :)

HeavenFox pushed a commit to docsend/uppy that referenced this pull request Jun 27, 2023
| Package                | Version | Package                | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/angular          |   0.5.0 | @uppy/image-editor     |   2.1.0 |
| @uppy/aws-s3-multipart |   3.1.0 | @uppy/locales          |   3.0.4 |
| @uppy/companion        |   4.1.0 | @uppy/tus              |   3.0.5 |
| @uppy/companion-client |   3.1.0 | @uppy/utils            |   5.1.0 |
| @uppy/dashboard        |   3.2.0 | uppy                   |   3.3.0 |

- @uppy/companion: change default S3 expiry from 300 to 800 seconds (Merlijn Vos / transloadit#4206)
- @uppy/dashboard: Single file mode (Artur Paikin / transloadit#4188)
- @uppy/locales: Fix UZ locale (Merlijn Vos / transloadit#4178)
- @uppy/utils: update typings for `RateLimitedQueue` (Antoine du Hamel / transloadit#4204)
- @uppy/aws-s3-multipart: empty the queue when pausing (Antoine du Hamel / transloadit#4203)
- @uppy/image-editor: add checkered background (Livia Medeiros / transloadit#4194)
- @uppy/aws-s3-multipart: refactor rate limiting approach (Antoine du Hamel / transloadit#4187)
- @uppy/companion: send expiry time along side S3 signed requests (Antoine du Hamel / transloadit#4202)
- @uppy/companion-client: add support for `AbortSignal` (Antoine du Hamel / transloadit#4201)
- @uppy/companion-client: prevent preflight race condition (Mikael Finstad / transloadit#4182)
- @uppy/aws-s3-multipart: change limit to 6 (Antoine du Hamel / transloadit#4199)
- @uppy/utils: add `cause` support for `AbortError`s (Antoine du Hamel / transloadit#4198)
- meta: Fix bad example for setFileState (Tim Whitney / transloadit#4191)
- meta: Update code example for getFiles (Tim Whitney / transloadit#4189)
- meta: Fix issue with outdated comment. (Tim Whitney / transloadit#4192)
- @uppy/aws-s3-multipart: remove unused `timeout` option (Antoine du Hamel / transloadit#4186)
- meta: Remove dollar sign from command for easier copy/pasting (Youssef Victor / transloadit#4180)
- @uppy/aws-s3-multipart,@uppy/tus: fix `Timed out waiting for socket` (Antoine du Hamel / transloadit#4177)
- meta: Add note about facebook approval (Mikael Finstad / transloadit#4172)
- meta: add a manual deploy for website (Antoine du Hamel / transloadit#4171)
})
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for const LARGE_THUMBNAIL = 600 is not evident for all images, so here is one example where it does matter.

Without #generateLargeThumbnailIfSingleFile:

Screenshot 2024-07-20 at 00 06 16

With#generateLargeThumbnailIfSingleFile:

Screenshot 2024-07-20 at 00 05 43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single Image Mode?
7 participants